<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621679480709"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-- | Maybe type</span><span>
</span><span id="line-5"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Maybe</span><span>
</span><span id="line-6"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-7"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-8"></span><span class="hs-keyword">where</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#"><span class="hs-identifier">GHC.Num.Integer</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- See Note [Depend on GHC.Num.Integer] in GHC.Base</span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#"><span class="hs-identifier">GHC.Classes</span></a></span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">default</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Maybe type</span><span>
</span><span id="line-17"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-comment">-- | The 'Maybe' type encapsulates an optional value.  A value of type</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- @'Maybe' a@ either contains a value of type @a@ (represented as @'Just' a@),</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- or it is empty (represented as 'Nothing').  Using 'Maybe' is a good way to</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- deal with errors or exceptional cases without resorting to drastic</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- measures such as 'Prelude.error'.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- The 'Maybe' type is also a monad.  It is a simple kind of error</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- monad, where all errors are represented by 'Nothing'.  A richer</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- error monad can be built using the 'Data.Either.Either' type.</span><span>
</span><span id="line-28"></span><span class="hs-comment">--</span><span>
</span><span id="line-29"></span><span class="hs-keyword">data</span><span>  </span><span id="Maybe"><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-var">Maybe</span></a></span></span><span> </span><span id="local-6989586621679480708"><span class="annot"><a href="#local-6989586621679480708"><span class="hs-identifier hs-type">a</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span id="Nothing"><span class="annot"><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="Just"><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679480708"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-30"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679480703"><span id="local-6989586621679480706"><span class="annot"><span class="annottext">Maybe a -&gt; Maybe a -&gt; Bool
(Maybe a -&gt; Maybe a -&gt; Bool)
-&gt; (Maybe a -&gt; Maybe a -&gt; Bool) -&gt; Eq (Maybe a)
forall a. Eq a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Maybe a -&gt; Maybe a -&gt; Bool
$c/= :: forall a. Eq a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
== :: Maybe a -&gt; Maybe a -&gt; Bool
$c== :: forall a. Eq a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span>  </span><span class="hs-comment">-- ^ @since 2.01</span><span>
</span><span id="line-31"></span><span>           </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679480681"><span id="local-6989586621679480683"><span id="local-6989586621679480686"><span id="local-6989586621679480689"><span id="local-6989586621679480692"><span id="local-6989586621679480695"><span id="local-6989586621679480698"><span class="annot"><span class="annottext">Eq (Maybe a)
Eq (Maybe a)
-&gt; (Maybe a -&gt; Maybe a -&gt; Ordering)
-&gt; (Maybe a -&gt; Maybe a -&gt; Bool)
-&gt; (Maybe a -&gt; Maybe a -&gt; Bool)
-&gt; (Maybe a -&gt; Maybe a -&gt; Bool)
-&gt; (Maybe a -&gt; Maybe a -&gt; Bool)
-&gt; (Maybe a -&gt; Maybe a -&gt; Maybe a)
-&gt; (Maybe a -&gt; Maybe a -&gt; Maybe a)
-&gt; Ord (Maybe a)
Maybe a -&gt; Maybe a -&gt; Bool
Maybe a -&gt; Maybe a -&gt; Maybe a
Maybe a -&gt; Maybe a -&gt; Ordering
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
forall {a}. Ord a =&gt; Eq (Maybe a)
forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Maybe a
forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Ordering
min :: Maybe a -&gt; Maybe a -&gt; Maybe a
$cmin :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Maybe a
max :: Maybe a -&gt; Maybe a -&gt; Maybe a
$cmax :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Maybe a
&gt;= :: Maybe a -&gt; Maybe a -&gt; Bool
$c&gt;= :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
&gt; :: Maybe a -&gt; Maybe a -&gt; Bool
$c&gt; :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
&lt;= :: Maybe a -&gt; Maybe a -&gt; Bool
$c&lt;= :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
&lt; :: Maybe a -&gt; Maybe a -&gt; Bool
$c&lt; :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Bool
compare :: Maybe a -&gt; Maybe a -&gt; Ordering
$ccompare :: forall a. Ord a =&gt; Maybe a -&gt; Maybe a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></a></span></span></span></span></span></span></span></span><span> </span><span class="hs-comment">-- ^ @since 2.01</span><span>
</span><span id="line-32"></span><span>           </span><span class="hs-special">)</span><span>
</span><span id="line-33"></span></pre></body></html>